//
//  MovieListTableViewCell.m
//  UI_豆瓣项目
//
//  Created by dllo on 15/10/31.
//  Copyright (c) 2015年 关业达. All rights reserved.
//

#import "MovieListTableViewCell.h"
#import "AppTools.h"
#import "UIImageView+WebCache.h"
@implementation MovieListTableViewCell

- (void)dealloc
{
    [_nameLable release];
    [_movieImageView release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews
{
    UIImageView *imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(10, 15, 355, 160)];
    [imageView1 setImage:[UIImage imageNamed:@"bg_eventlistcell.png"]];
    [self.contentView addSubview:imageView1];
    [imageView1 release];
    
    self.nameLable = [[UILabel alloc] initWithFrame:CGRectMake(120, 60, 200, 50)];
    self.nameLable.font = [UIFont systemFontOfSize:20];
 //   self.nameLable.text = @"";
//    self.nameLable.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.nameLable];
    [_nameLable release];
    
    self.movieImageView = [[UIImageView alloc] initWithFrame:CGRectMake(20, 25, 90, 140)];
    [self.contentView addSubview:self.movieImageView];
    [_movieImageView release];
    
}

- (void)setAMovie:(Movie *)aMovie
{
    if (_aMovie != aMovie) {
        [_aMovie release];
        _aMovie = [aMovie retain];
    }
    NSURL *url = [NSURL URLWithString:self.aMovie.pic_url];
    [self.movieImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"1.jpg"]];
    self.nameLable.text = aMovie.movieName;
}







- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
